3.429 \(\int \frac {(d+e x^r) (a+b \log (c x^n))^2}{x} \, dx\)

Optimal. Leaf size=80 \[ \frac {d \left (a+b \log \left (c x^n\right )\right )^3}{3 b n}-\frac {2 b e n x^r \left (a+b \log \left (c x^n\right )\right )}{r^2}+\frac {e x^r \left (a+b \log \left (c x^n\right )\right )^2}{r}+\frac {2 b^2 e n^2 x^r}{r^3} \]

[Out]

2*b^2*e*n^2*x^r/r^3-2*b*e*n*x^r*(a+b*ln(c*x^n))/r^2+e*x^r*(a+b*ln(c*x^n))^2/r+1/3*d*(a+b*ln(c*x^n))^3/b/n

________________________________________________________________________________________

Rubi [A]  time = 0.14, antiderivative size = 80, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {2353, 2302, 30, 2305, 2304} \[ \frac {d \left (a+b \log \left (c x^n\right )\right )^3}{3 b n}-\frac {2 b e n x^r \left (a+b \log \left (c x^n\right )\right )}{r^2}+\frac {e x^r \left (a+b \log \left (c x^n\right )\right )^2}{r}+\frac {2 b^2 e n^2 x^r}{r^3} \]

Antiderivative was successfully verified.

[In]

Int[((d + e*x^r)*(a + b*Log[c*x^n])^2)/x,x]

[Out]

(2*b^2*e*n^2*x^r)/r^3 - (2*b*e*n*x^r*(a + b*Log[c*x^n]))/r^2 + (e*x^r*(a + b*Log[c*x^n])^2)/r + (d*(a + b*Log[
c*x^n])^3)/(3*b*n)

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2302

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)/(x_), x_Symbol] :> Dist[1/(b*n), Subst[Int[x^p, x], x, a + b*L
og[c*x^n]], x] /; FreeQ[{a, b, c, n, p}, x]

Rule 2304

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*Log[c*x^
n]))/(d*(m + 1)), x] - Simp[(b*n*(d*x)^(m + 1))/(d*(m + 1)^2), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2305

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*Lo
g[c*x^n])^p)/(d*(m + 1)), x] - Dist[(b*n*p)/(m + 1), Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{
a, b, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]

Rule 2353

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((f_.)*(x_))^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol]
:> With[{u = ExpandIntegrand[(a + b*Log[c*x^n])^p, (f*x)^m*(d + e*x^r)^q, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[
{a, b, c, d, e, f, m, n, p, q, r}, x] && IntegerQ[q] && (GtQ[q, 0] || (IGtQ[p, 0] && IntegerQ[m] && IntegerQ[r
]))

Rubi steps

\begin {align*} \int \frac {\left (d+e x^r\right ) \left (a+b \log \left (c x^n\right )\right )^2}{x} \, dx &=\int \left (\frac {d \left (a+b \log \left (c x^n\right )\right )^2}{x}+e x^{-1+r} \left (a+b \log \left (c x^n\right )\right )^2\right ) \, dx\\ &=d \int \frac {\left (a+b \log \left (c x^n\right )\right )^2}{x} \, dx+e \int x^{-1+r} \left (a+b \log \left (c x^n\right )\right )^2 \, dx\\ &=\frac {e x^r \left (a+b \log \left (c x^n\right )\right )^2}{r}+\frac {d \operatorname {Subst}\left (\int x^2 \, dx,x,a+b \log \left (c x^n\right )\right )}{b n}-\frac {(2 b e n) \int x^{-1+r} \left (a+b \log \left (c x^n\right )\right ) \, dx}{r}\\ &=\frac {2 b^2 e n^2 x^r}{r^3}-\frac {2 b e n x^r \left (a+b \log \left (c x^n\right )\right )}{r^2}+\frac {e x^r \left (a+b \log \left (c x^n\right )\right )^2}{r}+\frac {d \left (a+b \log \left (c x^n\right )\right )^3}{3 b n}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.15, size = 109, normalized size = 1.36 \[ \frac {e x^r \left (a^2 r^2-2 a b n r+2 b^2 n^2\right )}{r^3}+a^2 d \log (x)+\frac {b \log ^2\left (c x^n\right ) \left (a d r+b e n x^r\right )}{n r}-\frac {2 b e x^r (b n-a r) \log \left (c x^n\right )}{r^2}+\frac {b^2 d \log ^3\left (c x^n\right )}{3 n} \]

Antiderivative was successfully verified.

[In]

Integrate[((d + e*x^r)*(a + b*Log[c*x^n])^2)/x,x]

[Out]

(e*(2*b^2*n^2 - 2*a*b*n*r + a^2*r^2)*x^r)/r^3 + a^2*d*Log[x] - (2*b*e*(b*n - a*r)*x^r*Log[c*x^n])/r^2 + (b*(a*
d*r + b*e*n*x^r)*Log[c*x^n]^2)/(n*r) + (b^2*d*Log[c*x^n]^3)/(3*n)

________________________________________________________________________________________

fricas [B]  time = 0.82, size = 193, normalized size = 2.41 \[ \frac {b^{2} d n^{2} r^{3} \log \relax (x)^{3} + 3 \, {\left (b^{2} d n r^{3} \log \relax (c) + a b d n r^{3}\right )} \log \relax (x)^{2} + 3 \, {\left (b^{2} e n^{2} r^{2} \log \relax (x)^{2} + b^{2} e r^{2} \log \relax (c)^{2} + 2 \, b^{2} e n^{2} - 2 \, a b e n r + a^{2} e r^{2} - 2 \, {\left (b^{2} e n r - a b e r^{2}\right )} \log \relax (c) + 2 \, {\left (b^{2} e n r^{2} \log \relax (c) - b^{2} e n^{2} r + a b e n r^{2}\right )} \log \relax (x)\right )} x^{r} + 3 \, {\left (b^{2} d r^{3} \log \relax (c)^{2} + 2 \, a b d r^{3} \log \relax (c) + a^{2} d r^{3}\right )} \log \relax (x)}{3 \, r^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x^r)*(a+b*log(c*x^n))^2/x,x, algorithm="fricas")

[Out]

1/3*(b^2*d*n^2*r^3*log(x)^3 + 3*(b^2*d*n*r^3*log(c) + a*b*d*n*r^3)*log(x)^2 + 3*(b^2*e*n^2*r^2*log(x)^2 + b^2*
e*r^2*log(c)^2 + 2*b^2*e*n^2 - 2*a*b*e*n*r + a^2*e*r^2 - 2*(b^2*e*n*r - a*b*e*r^2)*log(c) + 2*(b^2*e*n*r^2*log
(c) - b^2*e*n^2*r + a*b*e*n*r^2)*log(x))*x^r + 3*(b^2*d*r^3*log(c)^2 + 2*a*b*d*r^3*log(c) + a^2*d*r^3)*log(x))
/r^3

________________________________________________________________________________________

giac [B]  time = 0.32, size = 219, normalized size = 2.74 \[ \frac {1}{3} \, b^{2} d n^{2} \log \relax (x)^{3} + \frac {b^{2} n^{2} x^{r} e \log \relax (x)^{2}}{r} + b^{2} d n \log \relax (c) \log \relax (x)^{2} + \frac {2 \, b^{2} n x^{r} e \log \relax (c) \log \relax (x)}{r} + b^{2} d \log \relax (c)^{2} \log \relax (x) + a b d n \log \relax (x)^{2} + \frac {b^{2} x^{r} e \log \relax (c)^{2}}{r} - \frac {2 \, b^{2} n^{2} x^{r} e \log \relax (x)}{r^{2}} + \frac {2 \, a b n x^{r} e \log \relax (x)}{r} + 2 \, a b d \log \relax (c) \log \relax (x) - \frac {2 \, b^{2} n x^{r} e \log \relax (c)}{r^{2}} + \frac {2 \, a b x^{r} e \log \relax (c)}{r} + a^{2} d \log \relax (x) + \frac {2 \, b^{2} n^{2} x^{r} e}{r^{3}} - \frac {2 \, a b n x^{r} e}{r^{2}} + \frac {a^{2} x^{r} e}{r} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x^r)*(a+b*log(c*x^n))^2/x,x, algorithm="giac")

[Out]

1/3*b^2*d*n^2*log(x)^3 + b^2*n^2*x^r*e*log(x)^2/r + b^2*d*n*log(c)*log(x)^2 + 2*b^2*n*x^r*e*log(c)*log(x)/r +
b^2*d*log(c)^2*log(x) + a*b*d*n*log(x)^2 + b^2*x^r*e*log(c)^2/r - 2*b^2*n^2*x^r*e*log(x)/r^2 + 2*a*b*n*x^r*e*l
og(x)/r + 2*a*b*d*log(c)*log(x) - 2*b^2*n*x^r*e*log(c)/r^2 + 2*a*b*x^r*e*log(c)/r + a^2*d*log(x) + 2*b^2*n^2*x
^r*e/r^3 - 2*a*b*n*x^r*e/r^2 + a^2*x^r*e/r

________________________________________________________________________________________

maple [C]  time = 0.47, size = 1712, normalized size = 21.40 \[ \text {result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((e*x^r+d)*(b*ln(c*x^n)+a)^2/x,x)

[Out]

b^2*d*ln(c)^2*ln(x)+1/3*b^2*d*n^2*ln(x)^3+a^2*d*ln(x)+b^2*(d*r*ln(x)+e*x^r)/r*ln(x^n)^2+1/r*a^2*e*x^r-b*(-I*Pi
*ln(x)*b*d*csgn(I*x^n)*csgn(I*c*x^n)^2*r^2+I*Pi*ln(x)*b*d*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)*r^2+I*Pi*ln(x)*b
*d*csgn(I*c*x^n)^3*r^2-I*Pi*ln(x)*b*d*csgn(I*c*x^n)^2*csgn(I*c)*r^2-I*Pi*b*e*csgn(I*x^n)*csgn(I*c*x^n)^2*x^r*r
+I*Pi*b*e*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)*x^r*r+I*Pi*b*e*csgn(I*c*x^n)^3*x^r*r-I*Pi*b*e*csgn(I*c*x^n)^2*cs
gn(I*c)*x^r*r+b*d*n*ln(x)^2*r^2-2*ln(c)*ln(x)*b*d*r^2-2*b*e*r*x^r*ln(c)-2*ln(x)*a*d*r^2-2*a*e*r*x^r+2*b*e*n*x^
r)/r^2*ln(x^n)+1/2*csgn(I*c)*csgn(I*c*x^n)^3*csgn(I*x^n)^2*d*b^2*ln(x)*Pi^2-1/4*csgn(I*c*x^n)^4*csgn(I*x^n)^2*
d*b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*x^n)^3-I*ln(c)
*Pi*ln(x)*b^2*d*csgn(I*c*x^n)^3-I*Pi*ln(x)*a*b*d*csgn(I*c*x^n)^3

________________________________________________________________________________________

maxima [A]  time = 1.26, size = 131, normalized size = 1.64 \[ \frac {b^{2} e x^{r} \log \left (c x^{n}\right )^{2}}{r} + \frac {b^{2} d \log \left (c x^{n}\right )^{3}}{3 \, n} - 2 \, b^{2} e {\left (\frac {n x^{r} \log \left (c x^{n}\right )}{r^{2}} - \frac {n^{2} x^{r}}{r^{3}}\right )} + \frac {2 \, a b e x^{r} \log \left (c x^{n}\right )}{r} + \frac {a b d \log \left (c x^{n}\right )^{2}}{n} + a^{2} d \log \relax (x) - \frac {2 \, a b e n x^{r}}{r^{2}} + \frac {a^{2} e x^{r}}{r} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x^r)*(a+b*log(c*x^n))^2/x,x, algorithm="maxima")

[Out]

b^2*e*x^r*log(c*x^n)^2/r + 1/3*b^2*d*log(c*x^n)^3/n - 2*b^2*e*(n*x^r*log(c*x^n)/r^2 - n^2*x^r/r^3) + 2*a*b*e*x
^r*log(c*x^n)/r + a*b*d*log(c*x^n)^2/n + a^2*d*log(x) - 2*a*b*e*n*x^r/r^2 + a^2*e*x^r/r

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.01 \[ \int \frac {\left (d+e\,x^r\right )\,{\left (a+b\,\ln \left (c\,x^n\right )\right )}^2}{x} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((d + e*x^r)*(a + b*log(c*x^n))^2)/x,x)

[Out]

int(((d + e*x^r)*(a + b*log(c*x^n))^2)/x, x)

________________________________________________________________________________________

sympy [A]  time = 25.98, size = 309, normalized size = 3.86 \[ \begin {cases} a^{2} d \log {\relax (x )} + \frac {a^{2} e x^{r}}{r} + a b d n \log {\relax (x )}^{2} + 2 a b d \log {\relax (c )} \log {\relax (x )} + \frac {2 a b e n x^{r} \log {\relax (x )}}{r} - \frac {2 a b e n x^{r}}{r^{2}} + \frac {2 a b e x^{r} \log {\relax (c )}}{r} + \frac {b^{2} d n^{2} \log {\relax (x )}^{3}}{3} + b^{2} d n \log {\relax (c )} \log {\relax (x )}^{2} + b^{2} d \log {\relax (c )}^{2} \log {\relax (x )} + \frac {b^{2} e n^{2} x^{r} \log {\relax (x )}^{2}}{r} - \frac {2 b^{2} e n^{2} x^{r} \log {\relax (x )}}{r^{2}} + \frac {2 b^{2} e n^{2} x^{r}}{r^{3}} + \frac {2 b^{2} e n x^{r} \log {\relax (c )} \log {\relax (x )}}{r} - \frac {2 b^{2} e n x^{r} \log {\relax (c )}}{r^{2}} + \frac {b^{2} e x^{r} \log {\relax (c )}^{2}}{r} & \text {for}\: r \neq 0 \\\left (d + e\right ) \left (\begin {cases} \frac {a^{2} \log {\left (c x^{n} \right )} + a b \log {\left (c x^{n} \right )}^{2} + \frac {b^{2} \log {\left (c x^{n} \right )}^{3}}{3}}{n} & \text {for}\: n \neq 0 \\\left (a^{2} + 2 a b \log {\relax (c )} + b^{2} \log {\relax (c )}^{2}\right ) \log {\relax (x )} & \text {otherwise} \end {cases}\right ) & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x**r)*(a+b*ln(c*x**n))**2/x,x)

[Out]

Piecewise((a**2*d*log(x) + a**2*e*x**r/r + a*b*d*n*log(x)**2 + 2*a*b*d*log(c)*log(x) + 2*a*b*e*n*x**r*log(x)/r
 - 2*a*b*e*n*x**r/r**2 + 2*a*b*e*x**r*log(c)/r + b**2*d*n**2*log(x)**3/3 + b**2*d*n*log(c)*log(x)**2 + b**2*d*
log(c)**2*log(x) + b**2*e*n**2*x**r*log(x)**2/r - 2*b**2*e*n**2*x**r*log(x)/r**2 + 2*b**2*e*n**2*x**r/r**3 + 2
*b**2*e*n*x**r*log(c)*log(x)/r - 2*b**2*e*n*x**r*log(c)/r**2 + b**2*e*x**r*log(c)**2/r, Ne(r, 0)), ((d + e)*Pi
ecewise(((a**2*log(c*x**n) + a*b*log(c*x**n)**2 + b**2*log(c*x**n)**3/3)/n, Ne(n, 0)), ((a**2 + 2*a*b*log(c) +
 b**2*log(c)**2)*log(x), True)), True))

________________________________________________________________________________________